//引入用户数据库模块
const PointsModel_DB = require("../models/PointsModel_DB")
//引入发送前端工具
const Response = require("../utils/ResponseEntity")

class PointsController {
    //获取所有知识点
    async findAll(req, res, next) {
        try {
            const data = await PointsModel_DB.find()
            if (data.length) res.send(Response.success({ msg: "查询成功", data }))
            else res.send(Response.error({ msg: "查询失败" }))
        } catch (error) {
            console.log(error);
            res.send(ResponseEntity.error({ msg: "服务器错误" }))
        }
    }
}

const points = new PointsController()
module.exports = points